********************************************************************************************************************************
******************* Replication Code of the Appendix for The Decline of Religion and Its Rise in Electoral Politics*****************************
************************************ John Huber and Ahmed Ezzledin Mohamed *****************************************************
********************************************************************************************************************************
log using "Appendix.log"

****** Import data 
set matsize 8000
set more off

************** Table (B.1)
use "wvs_relig.dta", clear 

qui reg  sdantigay sdbelief sdattendance  belief_attend  sdinc sdeduc employed  sdage sdage2 notlook  orthodox_i protestant_i catholic_i /// 
female    typecity1 typecity2   i.year i.ctry_survey_r [aw=S017] ,  vce(cluster ctry_survey_r)
est sto gay

qui reg   sdantiab  sdbelief sdattendance  belief_attend   sdinc sdeduc employed  sdage sdage2 notlook  orthodox_i protestant_i catholic_i /// 
female    typecity1 typecity2 i.year   i.ctry_survey_r [aw=S017] ,  vce(cluster ctry_survey_r)
est sto abort

qui reg   sdind_re  sdbelief sdattendance  belief_attend   sdinc sdeduc employed  sdage sdage2 notlook  orthodox_i protestant_i catholic_i /// 
female    typecity1 typecity2  i.year  i.ctry_survey_r [aw=S017] ,  vce(cluster ctry_survey_r)
est sto resp

qui reg   sdinequality  sdbelief sdattendance  belief_attend    sdinc sdeduc employed  sdage sdage2 notlook  orthodox_i protestant_i catholic_i /// 
female    typecity1 typecity2  i.year  i.ctry_survey_r [aw=S017] ,  vce(cluster ctry_survey_r)
est sto inequal


*********** Table (B.2)
reg  sdvote_loc c.sdbelief##c.sdattendance  sdincome_imp sdeduc employed  sdage sdage2 notlook  orthodox_i protestant_i catholic_i /// 
female  typecity1 typecity2 i.year i.ctry_survey_r  [aw=S017] ,  vce(cluster ctry_survey_r)
est sto vote_loc

reg  sdvote_nat c.sdbelief##c.sdattendance  sdincome_imp sdeduc employed  sdage sdage2 notlook  orthodox_i protestant_i catholic_i /// 
female  typecity1 typecity2 i.year i.ctry_survey_r   [aw=S017] ,  vce(cluster ctry_survey_r)
est sto vote_nat


*********** Table (B.3)
use votingfrac.dta, clear
decode S025, gen (S0251)
 
**Table fractableA1:
reg sdPVP sdcorr_part_spirit2   sdreligfrac4    sdlndm    sdover65  sdherfrel00     easteur africa  latin i.year if neoeurope==0, cluster(country) 
eststo app1

reg sdPVP sdcorr_part_spirit2   sdreligfrac4    sdlndm     sdover65  sdherfrel00   neoeurope africa    latin i.year if easteurope==0 , cluster(country) 
eststo app2

reg sdPVP sdcorr_part_spirit2   sdreligfrac4    sdlndm     sdover65  sdherfrel00    neoeurope africa   easteur    i.year if latinam==0 , cluster(country) 
eststo app3

//Omitted based on the value of PVP>2
reg sdPVP sdcorr_part_spirit2   sdreligfrac4    sdlndm     sdover65  sdherfrel00   neoeurope africa  easteur latinam  i.year if ///
S0251~="Greece (2017)" & S0251~="United States (2011)" & S0251~="United States (2017)" & S0251~="Poland (2012)" & S0251~="Spain (1990)" & S0251~="Spain (1995)"  & S0251~="Spain (2007)"  & country~="Argentina (1995)", cluster(country) 
eststo app4

reg sdPVF sdcorr_part_spirit2   sdreligfrac4    sdlndm     sdover65  sdherfrel00  neoeurope africa       easteur latinam i.year , cluster(country) 
eststo app5

reg sdVF sdcorr_part_spirit2   sdreligfrac4    sdlndm     sdover65  sdherfrel00   neoeurope africa         easteur latinam  i.year , cluster(country) 
eststo app6

reg sdVP sdcorr_part_spirit2   sdreligfrac4    sdlndm     sdover65  sdherfrel00      neoeurope africa      easteur latinam  i.year , cluster(country) 
eststo app7


esttab app1 app2 app3 app4 app5 app6 app7, tex replace cells(b(star fmt(3)) se(par fmt(3)))  style(tex)  star(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
		keep(  sdcorr_part_spirit2        sdover65  sdherfrel00   sdreligfrac4  easteurope latinam sdlndm africa neoeurope) ///
		stats(r2 N, fmt(%9.3f %9.0g) labels("R$^2$" Obs)) ///
		varlabels( sdcorr_part_spirit2 "{\sc religious congruence}" sdlndm "{\sc dm}" sdlngdp_l5 "{\sc ln(gdp)}" sdgini_ml5 "\sc{gini}" ///
	    sdover65 "{\sc over 65}" sdstatefund_ch "{\sc state funding}" sdherfrel00 "{\sc frac. religions sects}" sdreligfrac4 "{\sc frac. religious groups}" catholic "{\sc catholic}" orthodox "{\sc orthodox}"  ///
		easteurope "{\sc east/central europe}" latinam "{\sc latin america}" sdlndm "{\sc dm}" africa "{\sc africa}" neoeurope "{\sc neo-europe}")

		
********** Table (B.4)
gen sdmean_attend2=sdmean_attend*sdmean_attend
gen sdmean_bel2=sdmean_bel*sdmean_bel

reg sdPVP sdcorr_part_spirit2  sdmean_bel sdmean_bel2 sdreligfrac4  sdlndm  sdover65  sdherfrel00  easteur latinam neoeurope africa  i.year, cluster(country) 
eststo m1

reg sdPVP sdcorr_part_spirit2  sdmean_attend sdmean_attend2 sdreligfrac4 sdlndm sdover65  sdherfrel00   easteur latinam neoeurope africa  i.year , cluster(country)
eststo m2		


esttab m1 m2, tex replace cells(b(star fmt(3)) se(par fmt(3)))  style(tex)  ///
		keep(  sdcorr_part_spirit2        sdover65  sdherfrel00   sdreligfrac4  easteurope latinam sdmean_attend sdmean_attend2 sdmean_bel sdmean_bel2 sdlndm africa neoeurope) ///
		stats(r2 N, fmt(%9.3f %9.0g) labels("R$^2$" Obs)) ///
		varlabels( sdrc_controls "{\sc religious congruence}" sdlndm "{\sc dm}" sdlngdp_l5 "{\sc ln(gdp)}" sdgini_ml5 "\sc{gini}" ///
	    sdover65 "{\sc over 65}" sdstatefund_ch "{\sc state funding}" sdherfrel00 "{\sc frac. religions sects}" sdreligfrac4 "{\sc frac. religious groups}" catholic "{\sc catholic}" orthodox "{\sc orthodox}"  ///
		easteurope "{\sc east/central europe}" latinam "{\sc latin america}" sdmean_bel "Belief" sdmean_bel2 "Belief-sq" sdmean_attend "Attendance" sdmean_attend2 "Attendance-sq"  sdlndm "{\sc dm}" africa "{\sc africa}" neoeurope "{\sc neo-europe}")
 

************* Table (C.5)
//Import the data
use "wvs_relig.dta", clear

//GDP Models
xtmixed   sdattendance c.sdbelief##c.sdlngdp_l5     sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017]  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa1

xtmixed   sdattendance c.sdbelief##c.sdlngdp_l5     sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year if income_imp<=4  [w=S017] || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa2

xtmixed   sdattendance c.sdbelief##c.sdlngdp_l5     sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year if income_imp>=7 [w=S017] || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa3

estout    pa1 pa2 pa3,   replace ///
cells(b(star fmt(3)) se(par fmt(3) )) ///
keep(sdbelief c.sdbelief#c.sdlngdp_l5 sdlngdp_l5 sdincome_imp sdeducation female orthodox_i protestant_i catholic_i sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic) ///
varlabels(  sdbelief "{\sc belief}" sdredis_l5 "{\sc redistribution}" c.sdbelief#c.sdlngdp_l5 "{\sc belief*(ln)gdp}"   sdgini_nl5 "{\sc gini}" sdlngdp_l5 "{\sc (ln)gdp}" employed "{\sc employed}" female "{\sc female}"  sdincome_imp "{\sc income (std)" ///
 sdeducation "{\sc education (std)}" notlooking "{\sc out labor force}" sdage "{\sc age(std)}" sdage2 "{\sc age-sq(std)}" orthodox_i "{\sc orthodox}" protestant_i "{\sc protestant}" catholic_i "{\sc catholic}" sdbelief "{\sc belief(std)}" sdattendance "{\sc attendance(std)}" typecity1 "{\sc Rural/town}" ///
 typecity2 "{\sc small city}" c.sdbelief#c.sdredis_l5 "{\sc belief*redistribution}" c.sdbelief#c.sdgini_nl5 "{\sc belief*gini(net)" sdstatefund_ch "{\sc statefund}"sdorthodox "{\sc orthodox (std)}" sdcatholic "{\sc catholic (std)}"}) ///
style(tex) ///
stats(N, fmt(0))


************ Table (C.6)
// Gini Models
xtmixed   sdattendance c.sdbelief##c.sdgini_nl5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017]  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa4

xtmixed   sdattendance c.sdbelief##c.sdgini_nl5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year if income_imp<=4 [w=S017]  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa5

xtmixed   sdattendance c.sdbelief##c.sdgini_nl5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year if income_imp>=7 [w=S017]  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa6

estout    pa4 pa5 pa6,   replace ///
cells(b(star fmt(3)) se(par fmt(3) )) ///
keep(sdbelief c.sdbelief#c.sdgini_nl5 sdgini_nl5 sdincome_imp sdeducation female orthodox_i protestant_i catholic_i sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic) ///
varlabels(  sdbelief "{\sc belief}" sdredis_l5 "{\sc redistribution}" c.sdbelief#c.sdlngdp_l5 "{\sc belief*(ln)gdp}"   sdgini_nl5 "{\sc gini}" sdlngdp_l5 "{\sc (ln)gdp}" employed "{\sc employed}" female "{\sc female}"  sdincome_imp "{\sc income (std)" ///
 sdeducation "{\sc education (std)}" notlooking "{\sc out labor force}" sdage "{\sc age(std)}" sdage2 "{\sc age-sq(std)}" orthodox_i "{\sc orthodox}" protestant_i "{\sc protestant}" catholic_i "{\sc catholic}" sdbelief "{\sc belief(std)}" sdattendance "{\sc attendance(std)}" typecity1 "{\sc Rural/town}" ///
 typecity2 "{\sc small city}" c.sdbelief#c.sdredis_l5 "{\sc belief*redistribution}" c.sdbelief#c.sdgini_nl5 "{\sc belief*gini(net)" sdstatefund_ch "{\sc statefund}"sdorthodox "{\sc orthodox (std)}" sdcatholic "{\sc catholic (std)}"}) ///
style(tex) ///
stats(N, fmt(0))

************ Table (C.7)
// Redistribution Models
xtmixed   sdattendance c.sdbelief##c.sdredis_l5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017]  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa7

xtmixed   sdattendance c.sdbelief##c.sdredis_l5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year if income_imp<=4 [w=S017]  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa8

xtmixed   sdattendance c.sdbelief##c.sdredis_l5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year if income_imp>=7 [w=S017]  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa9 

estout    pa7 pa8 pa9,   replace ///
cells(b(star fmt(3)) se(par fmt(3) )) ///
keep(sdbelief c.sdbelief#c.sdredis_l5 sdredis_l5 sdincome_imp sdeducation female orthodox_i protestant_i catholic_i sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic) ///
varlabels(  sdbelief "{\sc belief}" sdredis_l5 "{\sc redistribution}" c.sdbelief#c.sdlngdp_l5 "{\sc belief*(ln)gdp}"   sdgini_nl5 "{\sc gini}" sdlngdp_l5 "{\sc (ln)gdp}" employed "{\sc employed}" female "{\sc female}"  sdincome_imp "{\sc income (std)" ///
 sdeducation "{\sc education (std)}" notlooking "{\sc out labor force}" sdage "{\sc age(std)}" sdage2 "{\sc age-sq(std)}" orthodox_i "{\sc orthodox}" protestant_i "{\sc protestant}" catholic_i "{\sc catholic}" sdbelief "{\sc belief(std)}" sdattendance "{\sc attendance(std)}" typecity1 "{\sc Rural/town}" ///
 typecity2 "{\sc small city}" c.sdbelief#c.sdredis_l5 "{\sc belief*redistribution}" c.sdbelief#c.sdgini_nl5 "{\sc belief*gini(net)" sdstatefund_ch "{\sc statefund}"sdorthodox "{\sc orthodox (std)}" sdcatholic "{\sc catholic (std)}"}) ///
style(tex) ///
stats(N, fmt(0))

*********** Table (C.8)
xtmixed   sdattendance c.sdbelief##c.sdlngdp_l5     sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017] if neoeurope==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa1

xtmixed   sdattendance c.sdbelief##c.sdgini_nl5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017] if neoeurope==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa4

xtmixed   sdattendance c.sdbelief##c.sdredis_l5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017] if neoeurope==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa7

estout  pa1 pa4 pa7,   replace ///
cells(b(star fmt(3)) se(par fmt(3) )) ///
keep(sdbelief c.sdbelief#c.sdlngdp_l5 sdlngdp_l5 c.sdbelief#c.sdgini_nl5 sdredis_l5 c.sdbelief#c.sdredis_l5 sdgini_nl5 sdincome_imp sdeducation female) ///
varlabels(  sdbelief "{\sc belief}" sdredis_l5 "{\sc redistribution}" c.sdbelief#c.sdlngdp_l5 "{\sc belief*(ln)gdp}"   sdgini_nl5 "{\sc gini}" sdlngdp_l5 "{\sc (ln)gdp}" employed "{\sc employed}" female "{\sc female}"  sdincome_imp "{\sc income}" sdeducation "{\sc education}" notlooking "Out Labor Force" sdage "Age(std)" sdage2 "Age-sq(std)" orthodox_i "Orthodox" protestant_i "Protestant" catholic_i "Catholic" sdbelief "Belief(std)" sdattendance   "Attendance(std)" typecity1 "Rural/town" typecity2 "Small City" c.sdbelief#c.sdredis_l5 "{\sc belief*redistribution}" c.sdbelief#c.sdgini_nl5 "{\sc belief*gini(net)") ///
style(tex) ///
stats(N, fmt(0))


********** Table (C.9)
xtmixed   sdattendance c.sdbelief##c.sdlngdp_l5     sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017] if easteurope==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa1

xtmixed   sdattendance c.sdbelief##c.sdgini_nl5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017] if easteurope==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa4

xtmixed   sdattendance c.sdbelief##c.sdredis_l5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017] if easteurope==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa7

estout  pa1 pa4 pa7,   replace ///
cells(b(star fmt(3)) se(par fmt(3) )) ///
keep(sdbelief c.sdbelief#c.sdlngdp_l5 sdlngdp_l5 c.sdbelief#c.sdgini_nl5 sdredis_l5 c.sdbelief#c.sdredis_l5 sdgini_nl5 sdincome_imp sdeducation female) ///
varlabels(  sdbelief "{\sc belief}" sdredis_l5 "{\sc redistribution}" c.sdbelief#c.sdlngdp_l5 "{\sc belief*(ln)gdp}"   sdgini_nl5 "{\sc gini}" sdlngdp_l5 "{\sc (ln)gdp}" employed "{\sc employed}" female "{\sc female}"  sdincome_imp "{\sc income}" sdeducation "{\sc education}" notlooking "Out Labor Force" sdage "Age(std)" sdage2 "Age-sq(std)" orthodox_i "Orthodox" protestant_i "Protestant" catholic_i "Catholic" sdbelief "Belief(std)" sdattendance   "Attendance(std)" typecity1 "Rural/town" typecity2 "Small City" c.sdbelief#c.sdredis_l5 "{\sc belief*redistribution}" c.sdbelief#c.sdgini_nl5 "{\sc belief*gini(net)") ///
style(tex) ///
stats(N, fmt(0))


********** Table (C.10)
xtmixed   sdattendance c.sdbelief##c.sdlngdp_l5     sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017] if latinam==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa1

xtmixed   sdattendance c.sdbelief##c.sdgini_nl5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017] if latinam==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa4

xtmixed   sdattendance c.sdbelief##c.sdredis_l5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017] if latinam==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa7

estout  pa1 pa4 pa7,   replace ///
cells(b(star fmt(3)) se(par fmt(3) )) ///
keep(sdbelief c.sdbelief#c.sdlngdp_l5 sdlngdp_l5 c.sdbelief#c.sdgini_nl5 sdredis_l5 c.sdbelief#c.sdredis_l5 sdgini_nl5 sdincome_imp sdeducation female) ///
varlabels(  sdbelief "{\sc belief}" sdredis_l5 "{\sc redistribution}" c.sdbelief#c.sdlngdp_l5 "{\sc belief*(ln)gdp}"   sdgini_nl5 "{\sc gini}" sdlngdp_l5 "{\sc (ln)gdp}" employed "{\sc employed}" female "{\sc female}"  sdincome_imp "{\sc income}" sdeducation "{\sc education}" notlooking "Out Labor Force" sdage "Age(std)" sdage2 "Age-sq(std)" orthodox_i "Orthodox" protestant_i "Protestant" catholic_i "Catholic" sdbelief "Belief(std)" sdattendance   "Attendance(std)" typecity1 "Rural/town" typecity2 "Small City" c.sdbelief#c.sdredis_l5 "{\sc belief*redistribution}" c.sdbelief#c.sdgini_nl5 "{\sc belief*gini(net)") ///
style(tex) ///
stats(N, fmt(0))


********** Table (C.11)
xtmixed   sdattendance c.sdbelief##c.sdlngdp_l5     sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox i.year [w=S017] if catholic==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa1

xtmixed   sdattendance c.sdbelief##c.sdgini_nl5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox i.year [w=S017] if catholic==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa4

xtmixed   sdattendance c.sdbelief##c.sdredis_l5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox i.year [w=S017] if catholic==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa7

estout  pa1 pa4 pa7,   replace ///
cells(b(star fmt(3)) se(par fmt(3) )) ///
keep(sdbelief c.sdbelief#c.sdlngdp_l5 sdlngdp_l5 c.sdbelief#c.sdgini_nl5 sdredis_l5 c.sdbelief#c.sdredis_l5 sdgini_nl5 sdincome_imp sdeducation female) ///
varlabels(  sdbelief "{\sc belief}" sdredis_l5 "{\sc redistribution}" c.sdbelief#c.sdlngdp_l5 "{\sc belief*(ln)gdp}"   sdgini_nl5 "{\sc gini}" sdlngdp_l5 "{\sc (ln)gdp}" employed "{\sc employed}" female "{\sc female}"  sdincome_imp "{\sc income}" sdeducation "{\sc education}" notlooking "Out Labor Force" sdage "Age(std)" sdage2 "Age-sq(std)" orthodox_i "Orthodox" protestant_i "Protestant" catholic_i "Catholic" sdbelief "Belief(std)" sdattendance   "Attendance(std)" typecity1 "Rural/town" typecity2 "Small City" c.sdbelief#c.sdredis_l5 "{\sc belief*redistribution}" c.sdbelief#c.sdgini_nl5 "{\sc belief*gini(net)") ///
style(tex) ///
stats(N, fmt(0))

********* Table (C.12)
xtmixed   sdattendance c.sdbelief##c.sdlngdp_l5     sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017] if protestant==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa1

xtmixed   sdattendance c.sdbelief##c.sdgini_nl5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017] if protestant==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa4

xtmixed   sdattendance c.sdbelief##c.sdredis_l5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdorthodox sdcatholic i.year [w=S017] if protestant==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa7

estout  pa1 pa4 pa7,   replace ///
cells(b(star fmt(3)) se(par fmt(3) )) ///
keep(sdbelief c.sdbelief#c.sdlngdp_l5 sdlngdp_l5 c.sdbelief#c.sdgini_nl5 sdredis_l5 c.sdbelief#c.sdredis_l5 sdgini_nl5 sdincome_imp sdeducation female) ///
varlabels(  sdbelief "{\sc belief}" sdredis_l5 "{\sc redistribution}" c.sdbelief#c.sdlngdp_l5 "{\sc belief*(ln)gdp}"   sdgini_nl5 "{\sc gini}" sdlngdp_l5 "{\sc (ln)gdp}" employed "{\sc employed}" female "{\sc female}"  sdincome_imp "{\sc income}" sdeducation "{\sc education}" notlooking "Out Labor Force" sdage "Age(std)" sdage2 "Age-sq(std)" orthodox_i "Orthodox" protestant_i "Protestant" catholic_i "Catholic" sdbelief "Belief(std)" sdattendance   "Attendance(std)" typecity1 "Rural/town" typecity2 "Small City" c.sdbelief#c.sdredis_l5 "{\sc belief*redistribution}" c.sdbelief#c.sdgini_nl5 "{\sc belief*gini(net)") ///
style(tex) ///
stats(N, fmt(0))

********** Table (C.13)
xtmixed   sdattendance c.sdbelief##c.sdlngdp_l5     sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdprotestant sdcatholic i.year [w=S017] if orthodox==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa1

xtmixed   sdattendance c.sdbelief##c.sdgini_nl5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdprotestant sdcatholic i.year [w=S017] if orthodox==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa4

xtmixed   sdattendance c.sdbelief##c.sdredis_l5 sdlngdp_l5   sdincome_imp sdage sdage2 notlook employed female sdeduc orthodox_i protestant_i catholic_i  sdstatefund_ch typecity1 typecity2 sdprotestant sdcatholic i.year [w=S017] if orthodox==0  || ctry_survey_r:, vce(cluster ctry_survey_r)
est sto pa7

estout  pa1 pa4 pa7,   replace ///
cells(b(star fmt(3)) se(par fmt(3) )) ///
keep(sdbelief c.sdbelief#c.sdlngdp_l5 sdlngdp_l5 c.sdbelief#c.sdgini_nl5 sdredis_l5 c.sdbelief#c.sdredis_l5 sdgini_nl5 sdincome_imp sdeducation female) ///
varlabels(  sdbelief "{\sc belief}" sdredis_l5 "{\sc redistribution}" c.sdbelief#c.sdlngdp_l5 "{\sc belief*(ln)gdp}"   sdgini_nl5 "{\sc gini}" sdlngdp_l5 "{\sc (ln)gdp}" employed "{\sc employed}" female "{\sc female}"  sdincome_imp "{\sc income}" sdeducation "{\sc education}" notlooking "Out Labor Force" sdage "Age(std)" sdage2 "Age-sq(std)" orthodox_i "Orthodox" protestant_i "Protestant" catholic_i "Catholic" sdbelief "Belief(std)" sdattendance   "Attendance(std)" typecity1 "Rural/town" typecity2 "Small City" c.sdbelief#c.sdredis_l5 "{\sc belief*redistribution}" c.sdbelief#c.sdgini_nl5 "{\sc belief*gini(net)") ///
style(tex) ///
stats(N, fmt(0))

*********** Table (E.14) 
use votingfrac.dta, clear

sutex sdPVP sdPVF sdVF sdVP sdcorr_part_spirit2 sdreligfrac4 sdlndm sdlngdp_l5 sdgini_ml5 sdredis_l5 sdgini_nl5 sdmean_attend sdmean_bel sdover65 sdstatefund_ch sdherfrel00 catholic orthodox protestant  easteur latinam neoeurope,nobs minmax ///
replace file(decstat.text) title("Summary Statistics of Macro-Level Variables")


********** Table (E.15)
use wvs_relig.dta, clear 

sutex sdattend sdbelief sdinc sdeduc employed notlook sdage female orthodox_i protestant_i catholic_i typecity1 typecity2 typecity3 sdantigay sdantiab sdind_re sdinequality sdvote_loc sdvote_nat,nobs minmax ///
replace file(decstat.text) title("Summary Statistics of Micro-Level Variables")

log close
